import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import moment from "moment";
import { Form, Input, Select, Button, DatePicker, Row, Col, Table,Modal,message,Popconfirm } from 'antd';
// import './page1.scss'
// import NetUitl from '../../utils/HttpUtil';
// import "./page.scss";


class NoteModal extends Component {
    constructor(props) {
        super(props);
        this.state={
            noteValue:''
        }
    }

    componentWillReceiveProps(){
        const { allData } = this.props;
        if(!!allData){
            this.setState({
                noteValue:allData.remark
            })
        }
    }



    valChange = e =>{
        this.setState({
            noteValue:e.target.value
        })
    }


    render() {
        const { TextArea } = Input;
        const { title, noteVisible, handleNoteOK, handleNoteCancel } = this.props
        const {noteValue} = this.state
        return (

                <Modal
                    title={title}
                    visible={noteVisible}
                    cancelText='取消'
                    okText='确定'
                    onOk={handleNoteOK.bind(this,noteValue)}
                    onCancel={handleNoteCancel}
                    // destroyOnClose={true}
                >
                    <TextArea rows={4} value={this.state.noteValue} onChange={this.valChange}/>
                </Modal>
        );
    }
}
export default NoteModal;